<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">



        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>菜单管理</legend>
        </fieldset>

        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">菜单名称</label>
                <div class="layui-input-block">
                    <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入菜单名称" class="layui-input">
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">菜单类型</label>
                <div class="layui-input-block">
                    <select name="menuType" lay-filter="menuType">
                        <option value=""></option>
                        <option value="0">目录</option>
                        <option value="1" selected="">菜单</option>
                        <option value="2">节点</option>
                        <option value="3">超链接</option>
                      
                    </select>
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">父类菜单</label>
                <div class="layui-input-block">
                    <select name="parentId" lay-filter="parentId">
                        <option value=""></option>
                        <option value="0">根目录</option>
                        <option value="1" selected="">菜单</option>
                        <option value="2">节点</option>
                        <option value="3">超链接</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">路由地址</label>
                <div class="layui-input-block">
                    <input type="text" name="path" lay-verify="path" autocomplete="off" placeholder="请输入路由地址" class="layui-input">
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">路由参数</label>
                <div class="layui-input-block">
                    <input type="text" name="pathParam" lay-verify="pathParam" autocomplete="off" placeholder="请输入路由参数" class="layui-input">
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">请求方法</label>
                <div class="layui-input-block">
                    <select name="pathMethod" lay-filter="pathMethod">
                        <option value="GET" selected="">GET</option>
                        <option value="POST">POST</option>
                        <option value="PUT">PUT</option>
                        <option value="DEL">DEL</option>
                    </select>
                </div>
            </div>

			<div class="layui-form-item">
                <label class="layui-form-label">是否显示</label>
                <div class="layui-input-block">
                    <input type="radio" name="isShow" value="0" title="显示" checked="">
                    <input type="radio" name="isShow" value="1" title="隐藏">
                    
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">是否启用</label>
                <div class="layui-input-block">
                    <input type="radio" name="status" value="0" title="启用" checked="">
                    <input type="radio" name="status" value="1" title="禁用">
                    
                </div>
            </div>
			<div class="layui-form-item">
                <label class="layui-form-label">排序值</label>
                <div class="layui-input-inline">
                    <input type="text" name="orderNum" lay-verify="orderNum" value="100" placeholder="请输入排序值" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux"></div>
            </div>

			<div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <textarea placeholder="备注内容" name="bak" class="layui-textarea"></textarea>
                </div>
            </div>
             
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="menu">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>

     
    </div>
</div>

<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', ], function () {
        var form = layui.form
            , layer = layui.layer
        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 2) {
                    return '标题至少得2个字符啊';
                }
            }
        });
        //监听提交
        form.on('submit(menu)', function (data) {
            layer.alert(JSON.stringify(data.field), {
                title: '最终的提交信息'
            })
            return false;
        });

        //表单初始赋值
        /*
        form.val('example', {
            "username": "贤心" // "name": "value"
            , "password": "123456"
            , "interest": 1
            , "like[write]": true //复选框选中状态
            , "close": true //开关状态
            , "sex": "女"
            , "desc": "我爱 layui"
        })
        */


    });
</script>

</body>
</html>